New Functions in Week 2

nobs

{gdata}

Compute the number of non-missing observations

expression

{base}

Used in plots to add symbols to axes

which

{base}

return indexes of TRUE entries of a logical vector

bar

{base}

Used for annotations, such as “expression(paste(”-“,bar(y)))”

ggsave

{ggplot2}

Saves the last ggplot or a specified ggplot object to a file

sample

{base}

Takes a sample of the specified size

ifelse

{base}

Return a or b depending on the value of test

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

rnorm

{base}

Generate random numbers from a normal distribution

lm

{base}

Fit a linear model

data.frame

{base}

Create a data.frame from vectors

log

{base}

log (default base = e)

as.character

{base}

Coerce a vector to character

The end!